package Controlador;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

import Modelo.mCategoria;
import Modelo.mCompras;

public class cCompras {

		public void limpiar(JLabel jLabel4,JTextField jTextField1,JComboBox jComboBox1,JTextField jTextField2,JButton jButton1,JButton jButton2,JButton jButton3)
		{
			//jLabel4.setVisible(false);
			jTextField1.setText("");
			jComboBox1.setSelectedItem(0);
			jTextField2.setText("");
			jLabel4.setText("jLabel4");
			jButton1.setEnabled(true);
			jButton2.setEnabled(true);
			jButton3.setEnabled(true);		
			jTextField1.setEnabled(true);
		}


	public void guardar(JLabel jLabel4,JTextField jTextField1,JComboBox jComboBox1,JTextField jTextField2,JButton jButton1,JButton jButton2,JButton jButton3)
	{
		mCompras tCompras = new mCompras();
		tCompras.setCodCompra(Integer.parseInt(jTextField1.getText()));
		tCompras.setCodIngre(Integer.parseInt(jLabel4.getText()));
		tCompras.setCantidad(Integer.parseInt(jTextField2.getText()));
		tCompras.guardar();
		JOptionPane.showMessageDialog(null, "Actualizacion Completa");
		limpiar(jLabel4,jTextField1,jComboBox1,jTextField2,jButton1,jButton2, jButton3);
	}


}
